<div class="container">
    <div class="row">
                <div class="col-md-offset-1 col-md-10">
                    <div class="panel panel-default" style="min-height:500px;">
                        <div class="panel-heading">
                            <h3>My Ads</h3>
                        </div>
                        <div class="panel-body">

                        	<?php foreach($records as $row) { ?>
                            <div class="row">
                              <div class="col-md-6">
                                  <img src="<?php echo $row->img_1; ?>" style="width:50%">
                              </div>



                               <div class="col-md-6">
                                <h5 class="media-heading">Ad Title:</h5>
                                 <p style="margin-top:-25px; margin-left:75px;"><?php echo $row->ad_title; ?></p>
                                <h5 class="media-heading">Views:</h5>
                                 <p style="margin-top:-25px; margin-left:55px;"><?php echo $row->views; ?></p>
                                <h5 class="media-heading">Posted on:</h5>
                                 <p style="margin-top:-25px; margin-left:95px;"><?php echo $row->timestamp; ?></p>
                                 <h5 class="media-heading">Status:</h5>
                                 <p style="margin-top:-25px; margin-left:75px;"><?php
                                  if($row->active == 1){
                                    echo "Active";
                                 }
                                 else if($row->active == 0){
                                    echo "Deactivated";
                                 }
                                 else{
                                    echo "Waiting for approval";
                                 }?></p><br>
                                
                                <form  action=" <?php echo base_url('members/edit_ads'); ?>" method="post">
                                    <input  type="hidden" name="ad_id" value="<?php echo $row->ad_id; ?>">
                                    <input type="submit" value="Edit"   class="btn btn-info margin-sm">
                                </form>
                                  
                                <form style="margin-top:-38px; margin-left:58px;" action=" <?php echo base_url('members/delete_ads'); ?>" method="post">
                                    <input type="hidden" name="ad_id" value="<?php echo $row->ad_id; ?>">
                                    <input type="submit"  value="Delete" class="btn btn-danger margin-sm">
                                </form>
                                
                                  <?php if($row->active=='1' || $row->active=='2'){?>
                                  <form style="margin-top:-38px; margin-left:132px;" action=" <?php echo base_url('members/deactive_ads'); ?>" method="post">
                                    <input type="hidden" name="ad_id" value="<?php echo $row->ad_id; ?>">
                                    <input type="submit"  value="Deactivate" class="btn btn-primary margin-sm">
                                </form>
                                <?php }  ?> 
                                  <?php if($row->active=='1') {?>
                                  <form style="margin-top:-38px; margin-left:255px;" action=" #" method="post">
                                    <input type="button" style="background-color:#3B5998; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-weight:bold;"  value="Share on facebook" class="btn btn-info active margin-sm">
                                  </form>
                                  <?php }  ?> 

                                  <?php if($row->active=='0'){?>
                                    <form style="margin-top:-38px; margin-left:132px;" action=" <?php echo base_url('members/active_ads'); ?>" method="post">
                                      <input type="hidden" name="ad_id" value="<?php echo $row->ad_id; ?>">
                                      <input type="submit"  value="Activate" class="btn btn-success margin-sm">
                                  </form>
                                  <?php }  ?> 
                                </div>
                            </div>
                        <hr>
                        <?php } ?>    

        <div class="row">
            <div class="col-md-12">
                <center>
                    <?php echo $this->pagination->create_links(); ?>
                </center>
            </div>
        </div>
                            
                            
                         </div>    
                       </div>
                  </div>
     </div><!--End of Inbox Div -->
   </div>    